package com.sgb.goods.viewmodel;

import com.sgb.goods.api.GoodsCallBack;
import com.sgb.goods.api.GoodsNet;
import com.sgb.goods.entity.AppointEntity;
import com.sgb.goods.utils.base.viewmodel.BaseViewModel;
import com.sgb.goods.view.adapter.AppointInfoListAdapter;
import com.swgk.core.base.model.entity.BaseEntity;

import java.util.List;

/**
 * 约定信息
 * @author cyj
 */
public class AppointInfoModel extends BaseViewModel {

    public AppointInfoListAdapter adapter;

    public AppointInfoModel() {
        adapter = new AppointInfoListAdapter();
    }

    public void findAppoint(String orderId) {
        showLoading();
        GoodsNet.getInstance().getGoodsApi().findAppoint(orderId).enqueue(new GoodsCallBack<BaseEntity<List<AppointEntity>>>() {
            @Override
            public void onSuccess(BaseEntity<List<AppointEntity>> data) {
                adapter.setNewData(data.getData());
            }
        });
    }

}
